<template>
  <div id="app">
  <my-head></my-head>
  <div class="app_normal window">
    <div>
      <h1 class="h1">个人中心</h1>
      <hr>
    </div>


    <el-container>
    <div class="s_body">
      <div style="min-width:965px !important" class="common_container">
        <div class="main">

          <el-row class="tac">
            <dl class="silder" data-spm="table" data-spm-max-idx="8">
              <dt>
                <div style="position:absolute;width:100%;height:261px;background-color:#fff;opacity:0.7;z-index:11">
                </div>
                <img class="avator-bg" src="https://static.youku.com/user/img/avatar/310/6.jpg"/>
                <div style="position:relative;z-index:12" class="info">
                  <img style="border-radius:100%" :src=user.pic
                       class="avator"/>
                  <div class="name">
                    <span style="color:#333;font-weight:800">{{user.loginName}}</span>
                  </div>
                  <div>
                    <div class="vip-des">开通蜗牛会员尊享超值特权</div>
                    <a data-type="default" data-products data-tag="index_youku_btn" class="vip-link youku_vip_pay_btn"
                       href="javascript:void(0)" data-aplus-clk="x62_1c1a368f"
                       data-spm-anchor-id="user.playlsit.table.1" @click="showDialog(true)">开通会员</a>
                    <pay v-show="dialog_visible" :dialog_visible="dialog_visible" @dialogVisibleEvent="showDialog"></pay>

                  </div>
                </div>
              </dt>


              <el-col :span="12">
                <el-menu
                    default-active="1"
                    class="el-menu-vertical-demo"
                    @open="handleOpen"
                    @close="handleClose">
                    <el-menu-item index="1" @click="goTo('/userinfo')">
                      <span slot="title">我的资料</span>
                    </el-menu-item>
                    <el-menu-item index="2" @click="goTo('/navigation')">
                      <span slot="title">历史播放</span>
                    </el-menu-item>
                    <el-menu-item index="9" @click="goTo('/userorder')">
                      <span slot="title">订单详情 </span>
                    </el-menu-item>
                    <el-menu-item index="3" @click="goTo('/collect')">
                      <span slot="title">已购课程</span>
                    </el-menu-item>
                    <el-menu-item index="4" @click="goTo('/empty')">
                      <span slot="title">我的订阅</span>
                    </el-menu-item>
                    <el-menu-item index="5" @click="goTo('/vip')">
                      <span slot="title">VIP会员</span>
                  </el-menu-item>
                  <el-menu-item index="6" @click="goTo('/empty')">
                    <span slot="title">创作中心</span>
                  </el-menu-item>
                  <el-menu-item index="7" @click="goTo('/empty')">
                    <span slot="title">我的自频道</span>
                  </el-menu-item>
                  <el-menu-item index="8" @click="goTo('/message')">
                    <span slot="title">消息</span>
                  </el-menu-item>

                </el-menu>
              </el-col>


            </dl>
            <div class="record">
              <el-container>

                <el-main class="app-body">
                  <template>
                    <router-view/>
                  </template>
                </el-main>
              </el-container>
            </div>
          </el-row>
        </div>

      </div>

    </div>

    </el-container>
  </div>
    <my-footer></my-footer>
 </div>
</template>

<script>
    import axios from 'axios'
    import pay from '@/components/user/pay'
    export default {
        name: "",
      components: { pay },
        data(){

         return{
           dialog_visible: false,
           user:{
             token:'',
             loginName:'',
             nickName:'',
             pic:'',
           }
         }
        },
      methods: {
        showDialog(visible) {
          this.dialog_visible = visible;
        },
        handleOpen(key, keyPath) {
          console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
          console.log(key, keyPath);
        },
        goTo(path) {
          this.$router.replace(path);
        },
      },
        mounted(){
          axios.post("userapi/qflive-user/user/findUserByToken").then(res=>{
            console.log(res.data)
            if (res.data.success) {
              this.user=res.data.queryResult.object
            }
            if (res.data.code=="10006"){
              this.$router.push("/")
            }
          })
        }
    }
</script>

<style>
  .headline {
    text-align: center;
  }

  .delete {
    width: 16px;
    height: 16px;
    margin-left: 135px;
    cursor: pointer;
  }

  .app_normal {
    text-align: center;
    margin-top: 20px;
  }

  .main, .s_body {
    min-height: 600px;
  }

  .s_body {
    /*padding-top: 110px;*/
    color: #666;
  }

  .common_container {
    position: relative;
    text-align: left;
    /*margin: 0 100px;*/

    width: 1133px;
    margin-left: auto;
    margin-right: auto;
  }

  .main {
    position: relative;
    overflow: hidden;
  }

  .el-col-12 {
    width: 100%;
    text-align: center;
  }

  .el-menu-item {
    height: 40px;
    line-height: 40px;
  }

  .main .silder dt .avator-bg {
    display: block;
    position: absolute;
    top: 0;
    width: 244px;
    height: 261px;
    -webkit-filter: blur(20px);
    filter: blur(20px);
    z-index: 10;
  }

  .main .silder dt .avator {
    margin: 40px auto 0;
    width: 90px;
    height: 90px;
  }

  .silder img {
    display: block;
    border: 0;
  }

  .main .silder dt .name {
    margin-top: 12px;
    color: #333;
  }

  .main .silder dt .vip-des {
    margin-top: 5px;
  }

  .main .silder dt .vip-link {
    display: inline-block;
    margin-top: 15px;
    padding: 0 16px;
    height: 30px;
    line-height: 30px;
    background: #cca558;
    color: #333;
    border-radius: 15px;
  }

  a:focus, a:visited {
    text-decoration: none;
  }

  .main .silder {
    position: absolute;
    width: 246px;
  }

  .main .silder dt .vip-des {
    margin-top: 5px;
  }

  .main .silder dt {
    position: relative;
    width: -webkit-calc(100% - 2px);
    width: calc(100% - 2px);
    height: 261px;
    overflow: hidden;
    text-align: center;
    border: 1px solid #f8f8f8;
  }

  .record {
    width: -webkit-calc(100% - 246px);
    width: calc(100% - 246px);
    box-sizing: border-box;
    margin-left: 246px;
    min-width: 701px;
  }

  .g-col-s {
    width: 20%;
    float: left;
  }

  .g-box {
    margin-bottom: 20px;
  }

  .categorypack_yk_pack, .categorypack_yk_pack_focus, .categorypack_yk_pack_v {
    position: relative;
    text-align: left;
  }

  .categorypack_yk_pack .categorypack_pack_cover, .categorypack_yk_pack_focus .categorypack_pack_cover, .categorypack_yk_pack_v .categorypack_pack_cover {
    position: relative;
    /*padding-top: 10%;*/
    border-radius: 4px;
  }

  .categorypack_yk_pack .categorypack_pack_cover .categorypack_pack_close, .categorypack_yk_pack_focus .categorypack_pack_cover .categorypack_pack_close, .categorypack_yk_pack_v .categorypack_pack_cover .categorypack_pack_close {
    display: none;
    position: absolute;
    right: -6px;
    top: -10px;
    height: 22px;
    width: 22px;
    background: url(https://css.ykimg.com/youku/dist/img/find/record_32df6eb.png) 0 0 no-repeat;

    z-index: 1000;
  }

  .categorypack_yk_pack .categorypack_pack_cover a img, .categorypack_yk_pack_focus .categorypack_pack_cover a img, .categorypack_yk_pack_v .categorypack_pack_cover a img {
    display: block;
    width: 150px;
    height: 100px;
    overflow: hidden;
    border-radius: 4px;
  }
  .categorypack_yk_pack .categorypack_info_list, .categorypack_yk_pack_focus .categorypack_info_list, .categorypack_yk_pack_v .categorypack_info_list {
    position: relative;
    margin-top: 2px;
    padding: 7px 0 0;
    color: #999;
    z-index: 10;
  }
  .h1 {
    margin-left: -83% ;
  }

</style>

